package com.leo.blog.web.blogadmin;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/blogadmin", method = RequestMethod.GET)
public class BlogAdminController {
	@RequestMapping(value = "/tologin")
	public String toLogin() {
		return "login";
	}
	
	/**
	 * 退出
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/logout")
	public String logout(HttpServletRequest request) {
		request.getSession().removeAttribute("bloger");
		return "login";
	}
	
	@RequestMapping(value = "/adminindex")
	public String adminIndex() {
		//转发至后台页面
		return "admin/adminindex";
	}
	
	@RequestMapping(value = "/index")
	public String index() {
		//转发至首页
		return "admin/index";
	}
	
	@RequestMapping(value = "/addblog")
	public String addBlog() {
		//转发至发表博客页面
		return "admin/blog/addblog";
	}
	
	@RequestMapping(value = "/blogtable")
	public String blogTable() {
		//转发至博客管理页面
		return "admin/blog/blogtable";
	}
	
	@RequestMapping(value = "/updateblog")
	public String updateBlog() {
		//转发至编辑页面
		return "admin/blog/updateblog";
	}
	
	@RequestMapping(value = "/echarts")
	public String echarts() {
		//转发至图表主页
		return "admin/echarts/echarts";
	}
	
	@RequestMapping(value = "/info")
	public String info() {
		//查看阅读文章信息
		return "frontend/info";
	}
	
	@RequestMapping(value = "/findblog")
	public String findBlog() {
		//查询博客
		return "admin/blog/findblog";
	}
	
	@RequestMapping(value = "/blogtype")
	public String blogType() {
		//查询博客
		return "admin/blog/blogtype";
	}
	
	@RequestMapping(value = "/pics")
	public String pics() {
		//查询博客
		return "admin/pics/pics";
	}
	
	@RequestMapping(value = "/about")
	public String about() {
		//查询博客
		return "frontend/about";
	}
	
	@RequestMapping(value = "/ping")
	public String ping() {
		//查询博客
		return "admin/ping/ping";
	}
	
	@RequestMapping(value = "/headline")
	public String headline() {
		//查询博客
		return "admin/headline/headline";
	}
	
	@RequestMapping(value = "/user")
	public String user() {
		//查询博客
		return "admin/user/user";
	}
}
